package com.baixun.gasentity.dto;

import lombok.Data;

import java.util.List;

/**
 * 接收回调接口json
 */
@Data
public class AlgorithmCallbackRequest {

    private String appId;
    private Long projectId;
    private String algorithmSceneType;
    private String algorithmAbilityType;
    private PointInfo pointInfo;
    private DeviceInfo deviceInfo;
    private AnalysisResultData analysisResult;

    // Getters and Setters

    @Data
    public static class PointInfo {
        private Long pointId;
        private String pointName;
        private Long areaId;
        private String areaPath;
        private Long departmentId;
        private String departmentPath;
        private String extraInfo;

        // Getters and Setters
    }

    @Data
    public static class DeviceInfo {
        private Long deviceId;
        private String deviceName;
        private String extraInfo;

        // Getters and Setters
    }

    @Data
    public static class AnalysisResultData {
        private List<Event> event;
        private String videoUrl;
        private List<DetectArea> detectAreas;

        // Getters and Setters


        @Data
        public static class Event {
            private String eventType;
            private String eventId;
            private String eventStatus;
            private Long captureTime;
            private Snapshot snapshot;
            private Result result;

            // Getters and Setters



            @Data
            public static class Snapshot {
                private String url;
                private int width;
                private int hight;

                // Getters and Setters
            }

            @Data
            public static class Result {
                private List<Item> items;

                // Getters and Setters

                @Data
                public static class Item {
                    private String label;
                    private String cropSnapshotUrl;
                    private float score;
                    private Location location;

                    // Getters and Setters

                    @Data
                    public static class Location {
                        private int left;
                        private int top;
                        private int width;
                        private int height;

                        // Getters and Setters
                    }
                }
            }
        }

        @Data
        public static class DetectArea {
            private String type;
            private List<Side> sides;

            // Getters and Setters

            @Data
            public static class Side {
                private int startPointX;
                private int startPointY;
                private int endPointX;
                private int endPointY;

                // Getters and Setters
            }
        }
    }
}
